<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">

    <div class="modal-header">
        <h4 class="modal-title" id="myPlanLabel">Create or edit a Plan</h4>
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                (click)="clear()">&times;</button>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" [hidden]="!plan.id">
            <label for="id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                   [(ngModel)]="plan.id" readonly />
        </div>
        <div class="form-group">
            <label class="form-control-label" for="field_name">Name</label>
            <input type="text" class="form-control" name="name" id="field_name"
                [(ngModel)]="plan.name" required />
            <div [hidden]="!(editForm.controls.name?.dirty && editForm.controls.name?.invalid)">
                <small class="form-text text-danger"
                   [hidden]="!editForm.controls.name?.errors?.required">
                   This field is required.
                </small>
            </div>
        </div>
        <div class="form-group">
            <label class="form-control-label" for="field_classes">Classes</label>
            <input type="number" class="form-control" name="classes" id="field_classes"
                [(ngModel)]="plan.classes"  />
        </div>
        <div class="form-group">
            <label class="form-control-label" for="field_content">Content</label>
            <input type="text" class="form-control" name="content" id="field_content"
                [(ngModel)]="plan.content"  />
        </div>
        <div class="form-group">
            <label class="form-control-label" for="field_hits">Hits</label>
            <input type="number" class="form-control" name="hits" id="field_hits"
                [(ngModel)]="plan.hits"  />
        </div>
        <div class="form-group">
            <label class="form-control-label" for="field_updateTime">Update Time</label>
            <div class="d-flex">
                <input id="field_updateTime" type="datetime-local" class="form-control" name="updateTime" [(ngModel)]="plan.updateTime"
                  />
            </div>
        </div>

    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
            <span class="fa fa-ban"></span>&nbsp;<span>Cancel</span>
        </button>
        <button type="submit" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
            <span class="fa fa-save"></span>&nbsp;<span>Save</span>
        </button>
    </div>
</form>
